﻿using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace PortalWeb.Core.Entity
{
    [Table("RoleGroup", Schema = "dbo")]
    public class RoleGroup
    {
        [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public int Id { get; set; }

        public int? ParentId { get; set; }

        public string Name { get; set; }

        public virtual RoleGroup Parent { get; set; }

        public virtual ICollection<RoleGroup> Children { get; set; }

        /// <summary>
        ///  一对多关系
        /// </summary>
        public virtual ICollection<ApplicationRole> Roles { get; set; }
    }
}
